package com.dao.c.backend.controller;

import com.dao.c.backend.common.CommonResult;
import com.dao.c.backend.entity.Session;
import com.dao.c.backend.entity.User;
import com.dao.c.backend.service.ISessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张幸晔
 * @since 2025-02-22
 */
@RestController
@RequestMapping("/session")
//@CrossOrigin(allowedHeaders = "Authorization",exposedHeaders = "Authorization")
public class SessionController {
    @Autowired
    private ISessionService sessionService;


    @RequestMapping("/list")
    public CommonResult listAll(User user){
//        System.out.println(user);
       return sessionService.listAll(user);
    }


    @RequestMapping("/clearAll")
    public CommonResult clearAll(Session session){
        return sessionService.clearAll(session);
    }

    @RequestMapping("/delete")
    public CommonResult delete(Session session){
        return sessionService.delete(session);
    }



}
